<include file='Adduser/nav'/>
<div class='container'>
    <div class='row'>
        <div class='col-md-12'>
            <div class='panel panel-default'>
                <div class='panel-heading'>
                    <h4>用户管理</h4>
                </div>
                <table class='table table-hover'>
                    <thead>
                        <tr>
                            <th>用户名</th>
                            <th>短信平台用户</th>
                            <th>短信平台密码</th>
                            <th>短信平台apikey</th>
                            <th>营业区id</th>
                            <th>#</th>
                        </tr>
                    </thead>
                    <tbody>
                    <foreach name='users' item='user'>
                        <tr>
                            <td><{$user.uname}></td>
                            <td><{$user.msgname}></td>
                            <td><{$user.msgpass}></td>
                            <td><{$user.msgapikey}></td>
                            <td><{$user.orgseq}></td>
                            <td><a class="btn btn-danger btn-xs deluser" href='<{:U("Adduser/del",array("uid"=>$user["id"]))}>'>删除</a></td>
                        </tr>
                    </foreach>
                    </tbody>
                </table>    
            </div>
        </div>
    </div>
</div>
<script>
    $('.deluser').click(function(){
       var url = $(this).prop('href');
       $.get(
            url,
            function(data) {
                if (data.msg = "success") {
                    alert('删除成功');
                    window.location.reload();
                } else {
                    alert('删除失败');
                }
            }
       );
       return false;
    });
</script>
